add Matter Index Ui & Enhance ProbeJS support and add KJS functionality - #4
Conversation
動作確認は1.21.1のみ. getRawなどがモックになっていることに注意。 ProbeJS対応もあまりよろしくない
動作確認は1.21.1のみ. ProbeJS対応もあまりよろしくない
There was a problem hiding this comment.
Pull request overview
This PR expands Replicated Integration with a new client-side “Matter/Replication Index” UI, adds KubeJS-based matter override support (including enhanced ProbeJS typing help), and upgrades the selector pipeline to support richer rule selectors (including MOD-scoped selection).
Changes:
- Added Matter Index screen + tooltip/sidebar entrypoints, display scaling, and compact/exact matter amount formatting.
- Introduced rule-based selector model (
MatterRule/MatterRuleSelector) with MOD selectors and KubeJS override source priority. - Added/updated build + datagen integrations for KubeJS/ProbeJS across Forge 1.20.1 and NeoForge 1.21.1.
Reviewed changes
Copilot reviewed 71 out of 76 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| gradle/libs.versions.toml | Adds KubeJS/Architectury/Rhino/ProbeJS version-catalog entries. |
| gradle.properties | Bumps modVersion to 0.2.0. |
| common/src/test/kotlin/SimpleConversionSolverTest.kt | Adds a rule-ordering materialization test. |
| common/src/test/kotlin/MatterIndexDisplayScaleTest.kt | Unit tests for display scale stepping/clamping. |
| common/src/test/kotlin/MatterAmountFormatterTest.kt | Unit tests for compact/exact amount formatting. |
| common/src/main/kotlin/com/p_nsk/replicated_integration/api/selector/MutableMatterSelectors.kt | Reworks selectors to store ordered MatterRule list + snapshots. |
| common/src/main/kotlin/com/p_nsk/replicated_integration/api/selector/MatterSelectorStorageCodec.kt | Adds load/save for rule lists + MOD selector serialization. |
| common/src/main/kotlin/com/p_nsk/replicated_integration/api/selector/MatterSelectorMaterializer.kt | Adds rule-based materialization and MOD expansion hooks. |
| common/src/main/kotlin/com/p_nsk/replicated_integration/api/selector/MatterSelectorKind.kt | Adds MOD selector kind. |
| common/src/main/kotlin/com/p_nsk/replicated_integration/api/selector/MatterSelectorFormatter.kt | Formats MOD selectors for logs/UI. |
| common/src/main/kotlin/com/p_nsk/replicated_integration/api/selector/MatterRule.kt | Introduces rule + selector AST (static/any/all/not/predicate) and expansion context. |
| common/src/main/kotlin/com/p_nsk/replicated_integration/api/node/MatterNodeRegistry.kt | Ensures nodes can be stripped of commands while keeping safe enumerator/rawValue defaults. |
| common/src/main/kotlin/com/p_nsk/replicated_integration/api/node/MatterNodeDef.kt | Adds node enumeration + raw-value hooks used by rule predicates/not selectors. |
| common/src/main/kotlin/com/p_nsk/replicated_integration/api/model/ExplicitMatterValue.kt | Adds KUBEJS source priority between CONFIG and RUNTIME. |
| common/src/main/kotlin/com/p_nsk/replicated_integration/api/kubejs/RepInt.kt | Adds shared KubeJS-facing selector DSL + matter rule event builder. |
| common/src/main/kotlin/com/p_nsk/replicated_integration/api/client/MatterIndexModels.kt | Adds Matter Index record/query/filter/sort models. |
| common/src/main/kotlin/com/p_nsk/replicated_integration/api/client/MatterIndexDisplayScale.kt | Adds percent-based UI scaling helpers. |
| common/src/main/kotlin/com/p_nsk/replicated_integration/api/client/MatterAmountFormatter.kt | Adds compact/exact matter amount formatting + notation parsing. |
| buildSrc/src/main/kotlin/legacyforge-mod-conventions.gradle.kts | Uses a dedicated run-server directory for server and gametest server. |
| build.gradle.kts | Adds Architectury/JitPack/Latvian Maven repos for new deps. |
| 1.21.1-neo/src/main/resources/replicated_integration.mixins.json | Registers client mixin accessor for Neo UI injection. |
| 1.21.1-neo/src/main/resources/kubejs.plugins.txt | Declares NeoForge KubeJS/ProbeJS plugins. |
| 1.21.1-neo/src/main/kotlin/com/p_nsk/replicated_integration/ModMain.kt | Registers UI config, client events, and key mapping hooks on client dist. |
| 1.21.1-neo/src/main/kotlin/com/p_nsk/replicated_integration/kubejs/NeoRepIntProbeJSPlugin.kt | ProbeJS transform plugin for improved TS param typings. |
| 1.21.1-neo/src/main/kotlin/com/p_nsk/replicated_integration/kubejs/NeoRepIntMekKubeJSPlugin.kt | Registers Mek bindings for NeoForge KubeJS. |
| 1.21.1-neo/src/main/kotlin/com/p_nsk/replicated_integration/kubejs/NeoRepIntMek.kt | NeoForge Mek selector helpers. |
| 1.21.1-neo/src/main/kotlin/com/p_nsk/replicated_integration/kubejs/NeoRepIntKubeJSPlugin.kt | Registers bindings + events for NeoForge KubeJS matter rules. |
| 1.21.1-neo/src/main/kotlin/com/p_nsk/replicated_integration/kubejs/NeoRepInt.kt | NeoForge KubeJS selector helpers + whereItem predicate. |
| 1.21.1-neo/src/main/kotlin/com/p_nsk/replicated_integration/kubejs/NeoKubeJSMatterRules.kt | Collects NeoForge KubeJS rules only when kubejs is loaded. |
| 1.21.1-neo/src/main/kotlin/com/p_nsk/replicated_integration/data/NeoReplicatedIntegrationLanguageProvider.kt | Adds keymapping translations (en/ja). |
| 1.21.1-neo/src/main/kotlin/com/p_nsk/replicated_integration/data/NeoMatterRuntimeOverrides.kt | Exposes runtime overrides as MatterRule list. |
| 1.21.1-neo/src/main/kotlin/com/p_nsk/replicated_integration/data/NeoMatterConfigOverrides.kt | Stores config overrides as ordered rule list + saves/loads rules. |
| 1.21.1-neo/src/main/kotlin/com/p_nsk/replicated_integration/core/NeoReplicationCalculationService.kt | Integrates config + KubeJS + runtime rules into materialization pipeline. |
| 1.21.1-neo/src/main/kotlin/com/p_nsk/replicated_integration/core/NeoRecipeConversionSupport.kt | Skips recipe-derived conversions for SKIP_CALCULATION-tagged outputs. |
| 1.21.1-neo/src/main/kotlin/com/p_nsk/replicated_integration/core/NeoMatterNodeBuilder.kt | Adds per-node enumeration + raw value providers used by rule expansion. |
| 1.21.1-neo/src/main/kotlin/com/p_nsk/replicated_integration/core/Aliases.kt | Wires enumeration/rawValue into node registration. |
| 1.21.1-neo/src/main/kotlin/com/p_nsk/replicated_integration/config/NeoUiConfig.kt | Adds UI config for amount notation. |
| 1.21.1-neo/src/main/kotlin/com/p_nsk/replicated_integration/command/MatterCommandTree.kt | Adds MOD selector kind support for selector targeting. |
| 1.21.1-neo/src/main/kotlin/com/p_nsk/replicated_integration/client/MatterIndexScreen.kt | Adds NeoForge Matter Index screen implementation. |
| 1.21.1-neo/src/main/kotlin/com/p_nsk/replicated_integration/client/MatterIndexClientEvents.kt | Adds tooltip hold-to-open + sidebar button + key mapping registration (NeoForge). |
| 1.21.1-neo/src/main/kotlin/com/p_nsk/replicated_integration/adapter/vanilla/ReplicationVanillaAddon.kt | Adds enumeration/rawValue for item/fluid nodes + respects ReplicationTags crafting remainder tag. |
| 1.21.1-neo/src/main/kotlin/com/p_nsk/replicated_integration/adapter/vanilla/BuiltinNodeResolver.kt | Adds raw lookups + “all nodes” + mod-based node expansion helpers. |
| 1.21.1-neo/src/main/kotlin/com/p_nsk/replicated_integration/adapter/mekanism/ReplicationMekanismAddon.kt | Adds enumeration/rawValue hooks for chemical nodes. |
| 1.21.1-neo/src/main/kotlin/com/p_nsk/replicated_integration/adapter/mekanism/MekanismNodeResolver.kt | Adds “all chemical nodes”, mod expansion, and raw chemical lookups. |
| 1.21.1-neo/src/main/java/com/p_nsk/replicated_integration/mixin/neo/ScreenAccessor.java | NeoForge screen accessor invoker to inject sidebar button. |
| 1.21.1-neo/build.gradle.kts | Adds KubeJS/Architectury/Rhino/ProbeJS dependencies. |
| 1.20.1-forge/src/main/resources/replicated_integration.mixins.json | Registers client mixin accessor for Forge UI injection. |
| 1.20.1-forge/src/main/resources/kubejs.plugins.txt | Declares Forge KubeJS plugins. |
| 1.20.1-forge/src/main/kotlin/com/p_nsk/replicated_integration/ModMain.kt | Registers Forge UI config. |
| 1.20.1-forge/src/main/kotlin/com/p_nsk/replicated_integration/kubejs/ForgeRepIntMekKubeJSPlugin.kt | Registers Mek bindings for Forge KubeJS. |
| 1.20.1-forge/src/main/kotlin/com/p_nsk/replicated_integration/kubejs/ForgeRepIntMek.kt | Forge Mek selector helpers for multiple chemical types. |
| 1.20.1-forge/src/main/kotlin/com/p_nsk/replicated_integration/kubejs/ForgeRepIntKubeJSPlugin.kt | Registers bindings + events for Forge KubeJS matter rules. |
| 1.20.1-forge/src/main/kotlin/com/p_nsk/replicated_integration/kubejs/ForgeRepInt.kt | Forge KubeJS selector helpers + whereItem predicate. |
| 1.20.1-forge/src/main/kotlin/com/p_nsk/replicated_integration/kubejs/ForgeKubeJSMatterRules.kt | Collects Forge KubeJS rules only when kubejs is loaded. |
| 1.20.1-forge/src/main/kotlin/com/p_nsk/replicated_integration/data/ReplicatedIntegrationLanguageProvider.kt | Adds keymapping translations (en/ja). |
| 1.20.1-forge/src/main/kotlin/com/p_nsk/replicated_integration/data/ReplicatedIntegrationDataGen.kt | Registers ProbeJS doc provider in datagen. |
| 1.20.1-forge/src/main/kotlin/com/p_nsk/replicated_integration/data/ProbeJSDocumentProvider.kt | Generates ProbeJS documents JSON and documents list file. |
| 1.20.1-forge/src/main/kotlin/com/p_nsk/replicated_integration/data/ForgeMatterRuntimeOverrides.kt | Exposes runtime overrides as MatterRule list. |
| 1.20.1-forge/src/main/kotlin/com/p_nsk/replicated_integration/data/ForgeMatterConfigOverrides.kt | Stores config overrides as ordered rule list + saves/loads rules. |
| 1.20.1-forge/src/main/kotlin/com/p_nsk/replicated_integration/core/ForgeReplicationCalculationService.kt | Integrates config + KubeJS + runtime rules into materialization pipeline. |
| 1.20.1-forge/src/main/kotlin/com/p_nsk/replicated_integration/core/ForgeMatterNodeBuilder.kt | Adds per-node enumeration + raw value providers used by rule expansion. |
| 1.20.1-forge/src/main/kotlin/com/p_nsk/replicated_integration/core/Aliases.kt | Wires enumeration/rawValue into node registration. |
| 1.20.1-forge/src/main/kotlin/com/p_nsk/replicated_integration/config/ForgeUiConfig.kt | Adds UI config for amount notation. |
| 1.20.1-forge/src/main/kotlin/com/p_nsk/replicated_integration/command/MatterCommandTree.kt | Adds MOD selector kind support for selector targeting. |
| 1.20.1-forge/src/main/kotlin/com/p_nsk/replicated_integration/client/MatterIndexScreen.kt | Adds Forge Matter Index screen implementation. |
| 1.20.1-forge/src/main/kotlin/com/p_nsk/replicated_integration/client/MatterIndexClientEvents.kt | Adds tooltip hold-to-open + sidebar button + key mapping registration (Forge). |
| 1.20.1-forge/src/main/kotlin/com/p_nsk/replicated_integration/adapter/vanilla/ReplicationVanillaAddon.kt | Adds enumeration/rawValue hooks for item/fluid nodes (Forge). |
| 1.20.1-forge/src/main/kotlin/com/p_nsk/replicated_integration/adapter/vanilla/BuiltinNodeResolver.kt | Adds raw lookups + “all nodes” + mod-based node expansion helpers (Forge). |
| 1.20.1-forge/src/main/kotlin/com/p_nsk/replicated_integration/adapter/mekanism/ReplicationMekanismAddon.kt | Adds missing Mek tag command targets (Forge). |
| 1.20.1-forge/src/main/kotlin/com/p_nsk/replicated_integration/adapter/mekanism/MekanismNodeResolver.kt | Adds tag/mod expansion for Mek chemical node types (Forge). |
| 1.20.1-forge/src/main/java/com/p_nsk/replicated_integration/mixin/ScreenAccessor.java | Forge screen accessor invoker to inject sidebar button. |
| 1.20.1-forge/src/generated/resources/probejs/replicated_integration.json | Generated ProbeJS documents JSON. |
| 1.20.1-forge/src/generated/resources/probejs.documents.txt | Generated ProbeJS documents list file. |
| 1.20.1-forge/src/generated/resources/assets/replicated_integration/lang/ja_jp.json | Generated lang updates for keymapping strings. |
| 1.20.1-forge/src/generated/resources/assets/replicated_integration/lang/en_us.json | Generated lang updates for keymapping strings. |
| 1.20.1-forge/build.gradle.kts | Adds KubeJS/Architectury/Rhino + ProbeJS runtime dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| for (rule in rules) { | ||
| val selector = rule.selector.staticKey ?: continue | ||
| val value = rule.value | ||
| val json = JsonObject() | ||
| json.addProperty("selector", selector.kind.name.lowercase()) | ||
| json.addProperty("type", selector.type.toString()) |
| val values = linkedMapOf<NodeKey, ExplicitMatterValue>() | ||
| val expansion = MatterRuleExpansion(expandTag, expandMod, allNodes, rawValue) | ||
| for (rule in rules.sortedWith(compareBy<MatterRule> { it.source.priority })) { | ||
| val targets = rule.selector.expand(expansion) | ||
| for (target in targets) { | ||
| val current = values[target] | ||
| if (current == null || shouldReplace(current, explicitValue, specificity)) { | ||
| values[target] = AppliedValue(explicitValue, specificity) | ||
| } | ||
| values[target] = rule.value | ||
| } |
| fun snapshot(): Map<MatterSelectorKey, ExplicitMatterValue> { | ||
| val values = linkedMapOf<MatterSelectorKey, ExplicitMatterValue>() | ||
| for (rule in rules.sortedWith(compareBy<MatterRule> { it.source.priority })) { | ||
| val key = rule.selector.staticKey ?: continue | ||
| values[key] = rule.value | ||
| } |
| disintegratableButton.message = toggleLabel("D", disintegratableOnly) | ||
| indexScroll = 0 | ||
| }.bounds(replicatableButton.x + replicatableButton.width + 4, searchBox.y, 34, 18).build(), | ||
| ) | ||
| } | ||
|
|
||
| override fun render(guiGraphics: GuiGraphics, mouseX: Int, mouseY: Int, partialTick: Float) { | ||
| hoveredStack = ItemStack.EMPTY | ||
| hoveredAmountTooltip = emptyList() |
| private fun visibleEntries(): List<MatterIndexEntry> { | ||
| val query = MatterIndexFiltering.parseQuery(searchBox.value, matterOnly, replicatableOnly, disintegratableOnly) | ||
| val ordered = MatterIndexFiltering.filterAndSort(entries.map { it.record }, query, sort) | ||
| val byId = entries.associateBy { it.record.itemId } | ||
| return ordered.mapNotNull { byId[it.itemId] } |
| private fun visibleEntries(): List<MatterIndexEntry> { | ||
| val query = MatterIndexFiltering.parseQuery(searchBox.value, matterOnly, replicatableOnly, disintegratableOnly) | ||
| val ordered = MatterIndexFiltering.filterAndSort(entries.map { it.record }, query, sort) | ||
| val byId = entries.associateBy { it.record.itemId } | ||
| return ordered.mapNotNull { byId[it.itemId] } | ||
| } | ||
|
|
||
| private fun selectedEntry(): MatterIndexEntry? = | ||
| entries.firstOrNull { it.record.itemId == selectedItemId } | ||
|
|
||
| private fun equivalentEntries(): List<MatterIndexEntry> { | ||
| val records = MatterIndexFiltering.equivalentRecords(entries.map { it.record }, selectedEntry()?.record) | ||
| val byId = entries.associateBy { it.record.itemId } | ||
| return records.mapNotNull { byId[it.itemId] } |
Agent-Logs-Url: https://github.com/P-nutsK/ReplicatedIntegration/sessions/d7a45117-7699-4db9-9ca6-afbbbf75ebc1 Co-authored-by: P-nutsK <107553542+P-nutsK@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Agent-Logs-Url: https://github.com/P-nutsK/ReplicatedIntegration/sessions/d250a680-10f0-49b9-94b2-752c66825158 Co-authored-by: P-nutsK <107553542+P-nutsK@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot これらを解決するのは憂鬱で、やる気を削いでしまう問題だから、resolveされていない挙がった問題はmarkdownファイルとしてリポジトリに残しておいて。でも一旦放置することにする。 |
Agent-Logs-Url: https://github.com/P-nutsK/ReplicatedIntegration/sessions/f1dd3ce3-6124-4066-bdfc-1e5b2e79cb98 Co-authored-by: P-nutsK <107553542+P-nutsK@users.noreply.github.com>
対応しました。未解決の指摘を Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
No description provided.